package com.cn.intelligence.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.intelligence.pojo.EUDataGridResult;
import com.cn.intelligence.pojo.TaotaoResult;
import com.cn.intelligence.pojo.TbBrand;
import com.cn.intelligence.service.BrandService;

@Controller
@RequestMapping("/brand/")
public class BrandController {
	
	@Autowired
	BrandService brandService;
	
	 /**
     * 查询广告列表
     * @param page
     * @param rows
     * @return
     */
    @RequestMapping("list")
    @ResponseBody
    public EUDataGridResult getBrandList(Integer page,Integer rows,String filename){
        EUDataGridResult euDataGridResult =brandService.getBrandList(page,rows,filename);
        return euDataGridResult;
    }
    /**
     * 添加广告列表
     * @param page
     * @param rows
     * @return
     */
    @RequestMapping("addBrand")
    @ResponseBody
    public TaotaoResult addBrand(TbBrand tbBrand){
    	TaotaoResult euDataGridResult =brandService.addBrand(tbBrand);
        return euDataGridResult;
    }
    /**
     * 删除广告
     * @param page
     * @param rows
     * @return
     */
    @RequestMapping("deleteBrand")
    @ResponseBody
    public TaotaoResult deleteBrand(Long ids[]){
    	TaotaoResult euDataGridResult =brandService.deleteBrand(ids);
        return euDataGridResult;
    }
}
